import {playerActionCommand} from '../playerActionCommand';
import {Player} from '../Player';
export class Input {
    private static instance: Input

    private constructor() { }

    private keys = new Array(
        'a','d','w','s','c','space'
    )

    public static getInstance() {
        if (!Input.instance) {
            Input.instance = new Input()
        }
        return Input.instance
    }
    public key(key: string) {
        if(this.keys.includes(key)){
            console.log(key);
            let playerCommand = new playerActionCommand()
            playerCommand.execute<Player>(key)
        }
    }
}

